package com.dragons.spring5.jdbcTemplate;

import com.dragons.spring5.User;
import com.dragons.spring5.jdbcTemplate.entities.User5;
import com.dragons.spring5.jdbcTemplate.service.UserService;
import org.junit.Test;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestJdbcTemplate {
    @Test
    public void testAdd(){
        ApplicationContext context = new ClassPathXmlApplicationContext("jdbc-template.xml");
        UserService userService = context.getBean("userService", UserService.class);
        User5 user5 = new User5();
        user5.setUserId("123");
        user5.setUsername("aaa");
        user5.setUstatus("1");
        userService.addUser(user5);
    }

}
